﻿@inherits NantCom.NancyBlack.Modules.ContentSystem.NancyBlackRazorViewBase
<!DOCTYPE html>
<html>
<head>

    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">

    <link rel="shortcut icon" href="/Content/favicon.ico" />
    <link rel="icon" type="image/png" href="/Content/favicon.png" />

    <title>@RenderSection( "Title", false )</title>

    @if (this.RenderContext.Context.Request.Url.HostName == "localhost") // dev machine
    {
        <link href="/Content/bootstrap.min.css" rel="stylesheet" />
        <link href="/Content/bootstrap-theme.min.css" rel="stylesheet" />
        <link href="/Content/font-awesome.min.css" rel="stylesheet" />
    }
    else
    {
        <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" />
        <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap-theme.min.css" rel="stylesheet" />
        <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" />
    }

    @if (this.IsInEditMode)
    {
        <link href="/Content/Views/Editor/editor.css" rel="stylesheet" />
    }

    @RenderSection( "Head", false )
</head>
<body>
    <div id="fb-root"></div>

    @RenderBody()

    @if (this.RenderContext.Context.Request.Url.HostName == "localhost") // dev machine
    {
        <script src="/Content/Scripts/jquery-2.1.1.js"></script>
        <script src="/Content/Scripts/bootstrap.js"></script>
        <script src="/Content/Scripts/angular.js"></script>
        <script src="/Content/Scripts/angular-ui/ui-bootstrap-tpls.js"></script>

        <script src="/Content/Scripts/MobileServices.Web-1.1.5.min.js"></script>
    }
    else
    {
        <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.11.2/ui-bootstrap-tpls.min.js"></script>

        <script src="//ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.1.5.min.js"></script>
    }

    <script src="/Content/Views/Admin/admin-sharedmodules.js"></script>
    @RenderSection("Scripts", false)

    @if (this.IsInEditMode &&
        !this.Request.Url.Path.StartsWith("/Admin") &&
        !this.Request.Url.Path.StartsWith("/SuperAdmin"))
    {
        <script src="/Content/Views/Editor/editor.js"></script>
        @(this.Html.Partial("Editor/editorui.cshtml", this.Model))
    }

    <script>
        // combine all ng-module into one attribute on top of the page
        // too allow all modules to function
        var modules = [];
        $("*[ng-module]").each(function () {
            var me = $(this);
            modules.push(me.attr("ng-module"));
            me.removeAttr("ng-module");
        });

        if (modules.length > 0) {

            $("body").attr("ng-modules", modules.join(","));
        }
    </script>
    <script src="/Content/Scripts/angular.ngmodule.js"></script>

    <script>
        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v2.0";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>

</body>

</html>
